import React from 'react';
import {Card} from "antd";
import {data} from "@/app/blog/data";

// export const metadata: Metadata = {
//     title: `Blog - ${params.title}`
// }

interface IParams {
    params: {
        id: string
        title: string
        description: string
    }
}

export async function generateMetadata({params}: IParams) {
    return {
        title: `Blog - ${params.id}`
    }
}


function Page({params}: IParams) {
    const currentData = data.find(item => item.id === +params.id)
    return (
        <>
            <Card size="small" title={currentData?.title} style={{width: 300}}>
                <p>{currentData?.description}</p>
            </Card>
        </>
    )
}

export default Page;
